
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)

project(signal LANGUAGES C)

include_directories(../common)

set(COMPILE_ALL OFF)

list(APPEND _sources
    ../common/error.c
    ../common/prexit.c
    ../common/lockfile.c
    ../common/setfd.c
    ../common/setfl.c
    ../common/clrfl.c
    ../common/lockreg.c
    ../common/locktest.c
    ../common/tellwait.c
    03_clconn2.c
    04_initsrv1.c
    ../common/daemonize.c
)

if (COMPILE_ALL)
add_executable(findsvc 01_findsvc.c ${_sources})

add_executable(ruptime 05_ruptime.c ${_sources})
add_executable(ruptimed 06_ruptimed.c ${_sources})

add_executable(ruptimed-fd 07_ruptimed-fd.c ${_sources})

else()
add_executable(ruptime-dg 08_ruptime-dg.c ${_sources})
add_executable(ruptimed-dg 09_ruptimed-dg.c ${_sources})
endif()
